import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // 首页
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home')
  },
  // 种羊场 页面
  {
    path: '/zhongYangChang/:farmId/:name',
    name: 'ZhongYangChang',
    component: () => import('../views/zhongYangChang')
  },
  // 种羊场 详情
  {
    path: '/zhongYangChangDetail/:farmId/:farmName',
    name: 'ZhongYangChangDetail',
    component: () => import('../views/zhongYangChangDetail')
  },
  //  XXX 市
  {
    path: '/cityPage/:cityName',
    component: () => import('@/views/cityPage'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  //  XXX 旗
  {
    path: '/countyPage/:countyName',
    component: () => import('@/views/countyPage'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  //  XXX镇 
  {
    path: '/townPage/:townId/:townName',
    component: () => import('@/views/townPage'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  //  XXX镇 XXX村
  {
    path: '/villagePage/:townId/:townName/:villageId/:villageName',
    component: () => import('@/views/villagePage'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  //  XXX镇 XXX村 XXX牧户 
  {
    path: '/muHuPage/:townId/:townName/:villageId/:villageName/:muhuId/:muhuName/:muhuPhone',
    component: () => import('@/views/muHuPage'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  // 羊 详情页
  {
    path: '/sheepDetail/:sheep_id/:rfid/:muhuName',
    component: () => import('@/views/sheepDetail'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  // 交易页
  {
    path: '/transaction',
    component: () => import('@/views/transaction'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
  // amap
  {
    path: '/amap',
    component: () => import('@/views/amap'),
    hidden: true,
    meta: {
      requireAuth: true
    }
  },
]

const router = new VueRouter({
  // mode: 'hash',
  routes
})

export default router
